package bancosys.tec.persist.exception;

import jmine.tec.persist.PersistMessages;
import bancosys.tec.component.ComponentRuntimeException;
import bancosys.tec.exception.LocalizedMessageHolder;

/**
 * @version $Id: PersistenceException.java 132207 2012-03-19 18:49:06Z renato.lundberg $
 * @created Jan 19, 2007
 * @author Gustavo Almeida
 */
public class PersistenceException extends ComponentRuntimeException {

    /**
     * C'tor. Evite usá-lo, pois apresenta uma mensagem genérica pouco informativa.
     * 
     * @param cause a CAUSA desta exception.
     */
    public PersistenceException(Throwable cause) {
        this(PersistMessages.GENERIC_PERSISTENCE_ERROR.create(), cause);
    }

    /**
     * Construtor
     * 
     * @param messageHolder messageHolder
     * @param cause cause
     */
    public PersistenceException(LocalizedMessageHolder messageHolder, Throwable cause) {
        super(messageHolder, cause);
    }

    /**
     * Construtor
     * 
     * @param messageHolder messageHolder
     */
    public PersistenceException(LocalizedMessageHolder messageHolder) {
        super(messageHolder);
    }

    /**
     * @param key key
     * @param arguments arguments
     */
    @Deprecated
    public PersistenceException(String key, Object... arguments) {
        super(key, arguments);
    }

    /**
     * @param key key
     * @param cause cause
     * @param arguments arguments
     */
    @Deprecated
    public PersistenceException(String key, Throwable cause, Object... arguments) {
        super(key, cause, arguments);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getBundleBaseName() {
        return "jmine-tec-persist-messages";
    }
}
